PROJECT(ytags)

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

SET(CMAKE_BUILD_TYPE Debug)

# save the build result to top-level
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)

# lua source files
aux_source_directory(${PROJECT_SOURCE_DIR}/ytags/lua-src/src lua_files)

list(APPEND CMAKE_CXX_FLAGS "-Wall -ggdb")

ADD_EXECUTABLE(ytags
  "ytags/ytags.cpp"
  "ytags/unix.cpp"
  "ytags/utils.cpp"
  "ytags/lua_wrap.cpp"
  ${lua_files})

INCLUDE_DIRECTORIES(
  ${PROJECT_SOURCE_DIR}/ytags
  ${PROJECT_SOURCE_DIR}/ytags/lua-src/src)

TARGET_LINK_LIBRARIES(ytags
  pthread
  dl
  db)

ADD_EXECUTABLE(ytags_cpp
  "ytags_cpp/cpp.cpp"
  "ytags_cpp/cpp_lex.cpp")

INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ytags_cpp)
